<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>JSON Voorhees: jsonv::merge_rules Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://www.mathjax.org/mathjax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JSON Voorhees
   </div>
   <div id="projectbrief">Killer JSON for C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classjsonv_1_1merge__rules.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classjsonv_1_1merge__rules-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">jsonv::merge_rules Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__Algorithm.html">Algorithm</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>This class is used in <code>merge_explicit</code> for defining what the function should do in the cases of conflicts.  
 <a href="classjsonv_1_1merge__rules.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="algorithm_8hpp_source.html">jsonv/algorithm.hpp</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for jsonv::merge_rules:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
 <div class="center">
  <img src="classjsonv_1_1merge__rules.png" usemap="#jsonv::merge_5Frules_map" alt=""/>
  <map id="jsonv::merge_5Frules_map" name="jsonv::merge_rules_map">
<area href="classjsonv_1_1dynamic__merge__rules.html" title="An implementation of merge_rules that allows you to bind whatever functions you want to resolve confl..." alt="jsonv::dynamic_merge_rules" shape="rect" coords="0,56,179,80"/>
<area href="classjsonv_1_1recursive__merge__rules.html" title="These rules will recursively merge everything they can and coerce all values. " alt="jsonv::recursive_merge_rules" shape="rect" coords="189,56,368,80"/>
<area href="classjsonv_1_1throwing__merge__rules.html" title="These rules throw an exception on all conflicts. " alt="jsonv::throwing_merge_rules" shape="rect" coords="378,56,557,80"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab29737fbd64ca6ce54caf47062079b2e"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classjsonv_1_1value.html">value</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1merge__rules.html#ab29737fbd64ca6ce54caf47062079b2e">resolve_same_key</a> (<a class="el" href="classjsonv_1_1path.html">path</a> &amp;&amp;current_path, <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;a, <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;b) const =0</td></tr>
<tr class="memdesc:ab29737fbd64ca6ce54caf47062079b2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when merging a <code>kind::object</code> and the two objects share a key.  <a href="#ab29737fbd64ca6ce54caf47062079b2e">More...</a><br /></td></tr>
<tr class="separator:ab29737fbd64ca6ce54caf47062079b2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc104e701ff41714a9e084cb68f7700d"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classjsonv_1_1value.html">value</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1merge__rules.html#afc104e701ff41714a9e084cb68f7700d">resolve_type_conflict</a> (<a class="el" href="classjsonv_1_1path.html">path</a> &amp;&amp;current_path, <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;a, <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;b) const =0</td></tr>
<tr class="memdesc:afc104e701ff41714a9e084cb68f7700d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when <em>a</em> and <em>b</em> have <code>kind</code> values which are incompatible for merging.  <a href="#afc104e701ff41714a9e084cb68f7700d">More...</a><br /></td></tr>
<tr class="separator:afc104e701ff41714a9e084cb68f7700d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is used in <code>merge_explicit</code> for defining what the function should do in the cases of conflicts. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00277">277</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ab29737fbd64ca6ce54caf47062079b2e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classjsonv_1_1value.html">value</a> jsonv::merge_rules::resolve_same_key </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1path.html">path</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>current_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called when merging a <code>kind::object</code> and the two objects share a key. </p>
<p>The implementation can either throw or merge the keys.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">current_path</td><td>is the merge <code>path</code> with the key that conflicted appended. </td></tr>
    <tr><td class="paramname">a</td><td>is the left-hand <code>value</code> to merge. </td></tr>
    <tr><td class="paramname">b</td><td>is the right-hand <code>value</code> to merge. </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="classjsonv_1_1recursive__merge__rules.html#a6a3317aa96e43a28ccc7d3fdb5adf8b0">jsonv::recursive_merge_rules</a>, <a class="el" href="classjsonv_1_1throwing__merge__rules.html#ac24067f226d83ede5104e9403cdcacf4">jsonv::throwing_merge_rules</a>, and <a class="el" href="classjsonv_1_1dynamic__merge__rules.html#a058fd362ff4f1e0d2549916b787ac97d">jsonv::dynamic_merge_rules</a>.</p>

</div>
</div>
<a class="anchor" id="afc104e701ff41714a9e084cb68f7700d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classjsonv_1_1value.html">value</a> jsonv::merge_rules::resolve_type_conflict </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1path.html">path</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>current_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1value.html">value</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called when <em>a</em> and <em>b</em> have <code>kind</code> values which are incompatible for merging. </p>
<p>The implementation can either throw or coerce a merge.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">current_path</td><td><code>path</code> with the conflicting <code>kind</code> values. </td></tr>
    <tr><td class="paramname">a</td><td>is the left-hand <code>value</code> to merge. </td></tr>
    <tr><td class="paramname">b</td><td>is the right-hand <code>value</code> to merge. </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="classjsonv_1_1recursive__merge__rules.html#a1b7578354c574acdcde3d77998754401">jsonv::recursive_merge_rules</a>, <a class="el" href="classjsonv_1_1throwing__merge__rules.html#aff2fdb231a70faf30938361a0fcc434f">jsonv::throwing_merge_rules</a>, and <a class="el" href="classjsonv_1_1dynamic__merge__rules.html#a5aa7e53481c06ba09f9c166aaf833f50">jsonv::dynamic_merge_rules</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jsonv/<a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>jsonv</b></li><li class="navelem"><a class="el" href="classjsonv_1_1merge__rules.html">merge_rules</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
